
/*
消息总线
 */

import 'dart:isolate';

import 'package:flutter/material.dart';

class EventBus {
  final SendPort sendPort;
  EventBus({@required this.sendPort});

  static EventBus _i;
  static void initEventBus(SendPort p) {
    if(_i != null) {
      throw 'event bus init twice!!!';
    }
    _i = EventBus(sendPort: p);
  }

  factory EventBus.i() {
    return _i;
  }
}
